package com.morgan.basemodule.ext

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity

/**
 *description：
 *<br>author：caowugao
 *<br>time：2021/4/5 0005 15:43
 */

fun replace(act : FragmentActivity, containerId : Int, f : Fragment, tag : String?) {
    val transaction = act.supportFragmentManager.beginTransaction()
    transaction.replace(containerId, f, tag)
    transaction.commitAllowingStateLoss()
}

fun replace(act : FragmentActivity, containerId : Int, f : Fragment) {
    val transaction = act.supportFragmentManager.beginTransaction()
    transaction.replace(containerId, f)
    transaction.commitAllowingStateLoss()
}